#pragma once

#include <QWidget>
#include <QVector>

#include "ui_CShowTraceWidget.h"
#include "QtGroceryStore.h"
#include "CDrawGraph.h"

class QPainter;

class CShowTraceWidget : public QWidget
{
	Q_OBJECT
private slots:
	void OnGetPointInfo(QVector<QPointF> &_vec);
public:
	CShowTraceWidget(QWidget *parent = Q_NULLPTR);
	~CShowTraceWidget();
protected:
	virtual void paintEvent(QPaintEvent* event)override;
protected:
	void OnInitWidget()noexcept;
private:
	void InitLineDistance()noexcept;
	void InitAxisValue()noexcept;
	//
	void DrawBackground(QPainter* ptr);
	void DrawCoordinateAxis(QPainter* ptr);
	void DrawCoordinateLine(QPainter* ptr);
	void DrawUnit(QPainter* ptr);
	//void DrawPoint(QPainter* ptr, QPointF _point, QColor _color);
private:
	void TransitionCoordinate(QVector<QPointF>&);
private:
	QVector<QPointF>m_point_container;
private:
	Ui::CShowTraceWidget ui;
	LineDistance m_LineDistance;
	float m_XAxisValue[2];
	float m_YAxisValue[2];

};
